package com.trainoo.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/** 
 * <p> description here </p>
 * @author tao.zhou
 * @date 2020/6/15 16:07:00
 * @version 1.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.redis")
public class RedisProperties {

    private String hostName = "127.0.0.1";

    private int port = 6379;

    private int database = 0;

    private String password;

    private int timeout = 5000;

    private int shutdownTimeout;

    private String sentinelMaster;

    private String sentinelNodes;

    private String clusterNodes;

    private int clusterMaxRedirects;

    private int maxIdle = 300;

    private int minIdle = 100;

    private int maxTotal = 1000;

    private long maxWaitMillis = 15000;

    private boolean testOnCreate = true;

    private boolean testOnBorrow = true;

    private boolean testOnReturn = true;

    private boolean testWhileIdle = true;

    private long timeBetweenEvictionRunsMillis = 30000;

    private boolean enableTransactionSupport = true;

    private Cache cache = new Cache();
    @Data static class Cache{
        /**
         * 单位秒
         */
        private int timeToLive = 60 * 60;
    }

}
